﻿@model ServerManager.Models.Server

@{
    ViewData["Title"] = "Details";
}
<style>
    .listItem {
        margin-right: 10px;
    }
</style>
<div style="height:40px;line-height:40px;margin-top:10px;">
    <div style="float:left;font-size:2em;">服务器</div>
    <div style="float:right"><a class="btn btn-info" asp-action="Index">返回列表</a></div>
</div>
<div>
    <hr />
    <table class="my-table">
        <tr>
            <td class="col-md-1">@Html.DisplayNameFor(model => model.Brand) </td>
            <td class="col-md-5">@Html.DisplayFor(model => model.Brand)</td>
            <td class="col-md-1">@Html.DisplayNameFor(model => model.Cpu)</td>
            <td class="col-md-5">@Html.DisplayFor(model => model.Cpu)</td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(model => model.Memory) </td>
            <td>@Html.DisplayFor(model => model.Memory)</td>
            <td>@Html.DisplayNameFor(model => model.HardDisk)</td>
            <td>@Html.DisplayFor(model => model.HardDisk)</td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(model => model.Position) </td>
            <td>@Html.DisplayFor(model => model.Position)</td>
            <td>@Html.DisplayNameFor(model => model.Code)</td>
            <td>@Html.DisplayFor(model => model.Code)</td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(model => model.IpAddresses) </td>
            <td>
                @{
                    foreach (var i in Model.IpAddresses)
                    {
                        <span class="listItem">@i.Ip</span>
                    }
                }
            </td>
            <td>@Html.DisplayNameFor(model => model.Apps)</td>
            <td>
                @{
                    foreach (var a in Model.Apps)
                    {
                        <a asp-controller="App" asp-action="Details" asp-route-id="@a.Id"><span class="listItem">@a.Name</span></a>
                    }
                }
            </td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(model => model.Remark) </td>
            <td>@Html.DisplayFor(model => model.Remark)</td>
            <td></td>
            <td></td>
        </tr>
    </table>
   
</div>

<div>
    <a class="btn btn-danger" asp-action="Delete" asp-route-id="@Model.Id" onclick="javascript:if(confirm('确定要删除此信息吗？')){return true;}return false;">删除</a>
</div>
